<template>
	<view class="mask flex-center" v-if="isShow" >
		<view class="content botton-radius">
			
			<view class="content-header"></view>
			<view class="content-body">
				<view class="title">
					<text >公告</text>
				</view>
				<view class="body">
					<scroll-view class="box-des-scroll" scroll-y="true">
						<rich-text :nodes="content" class="box-des"></rich-text>
					
						</text>
					</scroll-view>
				</view>
				<view class="footer flex-center">
				
						<button @click="know" class="content-button" style="border: none;color: #fff;" plain>
							我已仔细阅读
						</button>
				</view>
			</view>

		<!-- 	<image v-if="!is_mandatory" class="close-img" src="/static/imgs/icons/app_update_close.png"
				@click.stop="closeUpdate"></image> -->
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				isShow:false,
				content:'<p>我们仅提供设备及相应设备设施，使用人须遵守治安管理条例,违者由使用人自行承担相应责任及后果</p><p>1.严禁未年人进入场所;</p><p>2.严禁黄.赌.毒打架斗殴等一切违法活动;</p><p>3.使用人须自行对身体状况负责,注意个人安全;</p><p>4.破坏或带走本场所提供的设备请照价赔偿;</p><p>5.请自行保管好私人物品,如有遗失概不负责;</p><p><br/></p>',
				title:'',
				id:''
			}
		},
		mounted() {
			//this.getNotice();
			var isTip = uni.getStorageSync("isTip");
			if(isTip != 1){
				this.isShow = true;
				uni.setStorageSync("isTip",1);
			}
		},
		
		methods: {
		
			getNotice(){
				let param = {}
				let that = this;
				this.$api.notice(param).then(res => {
				
					if (res.code == 1) {
						var id = res.data.id;
						that.id = id;
						var content = res.data.content;
						that.content = content;
						that.title = res.data.title;
						var msgId = uni.getStorageSync("notice")
						if(msgId != ''){
							
							if(id > msgId){
								that.isShow = true;
							}else{
								that.isShow = false;
								
							}
							console.info("==msgId 不未空==")
						}else{
							console.info("==msgId 为空==")
							that.isShow = true;
							
						}
					} else {
						
					}
				
				})
			},
			know(){
				this.isShow = false;	
				uni.setStorageSync("notice",this.id)
			}
		}
	}
</script>

<style>
	page {
		background: transparent;
	}

	.flex-center {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
	}

	.mask {
		z-index: 10;
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, .65);
	}

	.botton-radius {
		border-bottom-left-radius: 30rpx;
		border-bottom-right-radius: 30rpx;
		
		border-top-left-radius: 30rpx;
		border-top-right-radius: 30rpx;
	}

	.content {
		position: relative;
		top: 0;
		width: 600rpx;
		background-color: #fff;
		box-sizing: border-box;
		padding: 0 20rpx;
		font-family: Source Han Sans CN;
	}

	.text {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		line-height: 200px;
		text-align: center;
		color: #FFFFFF;
	}

	.content-top {
		position: absolute;
		top: -195rpx;
		left: 0;
		width: 600rpx;
		height: 70rpx;
	}

	.content-top-text {
		font-size: 45rpx;
		font-weight: bold;
		color: #F8F8FA;
		position: absolute;
		top: 120rpx;
		left: 50rpx;
		z-index: 1;
	}

	.content-header {
		height: 40rpx;
	}

	.title {
		font-size: 40rpx;
		font-weight: bold;
		color: #F6C454;
		line-height: 38px;
		text-align: center;
	}

	.footer {
		height: 150rpx;
		display: flex;
		align-items: center;
		justify-content: space-around;
	}

	.box-des-scroll {
		box-sizing: border-box;
		padding: 0 40rpx;
		height: 600rpx;
		text-align: left;
	}

	.box-des {
		font-size: 26rpx;
		color: #000000;
		line-height: 50rpx;
	}

	.progress-box {
		width: 100%;
	}

	.progress {
		width: 90%;
		height: 40rpx;
		border-radius: 35px;
	}

	.close-img {
		width: 70rpx;
		height: 70rpx;
		z-index: 1000;
		position: absolute;
		bottom: -120rpx;
		left: calc(50% - 70rpx / 2);
	}

	.content-button {
		text-align: center;
		flex: 1;
		font-size: 30rpx;
		font-weight: 400;
		color: #FFFFFF;
		border-radius: 40rpx;
		margin: 0 18rpx;

		height: 80rpx;
		line-height: 80rpx;

		background: linear-gradient(to right, #F8B62B, #F8B62B);
	}

	.flex-column {
		display: flex;
		flex-direction: column;
		align-items: center;
	}
</style>
